/*StaffDailyCheck  每日晨检*/
import request from "/@/utils/request";
import download from "/@/utils/download.ts";

const StaffDailyCheckApi = {

    getPageData(data: any) {
        return request({
            url: "/staffDailyCheck/pageData",
            method: "post",
            data,
        });
    },
    getDetail(data: any) {
        return request({
            url: "/staffDailyCheck/getDetail",
            method: "post",
            data,
        });
    },

    save: (data: any) => {
        return request({
            url: "/staffDailyCheck/save",
            method: "post",
            data,
        });
    },

    del: (data: any) => {
        return request({
            url: "/staffDailyCheck/del",
            method: "post",
            data,
        });
    },

    updateStatus: (data: any) => {
        return request({
            url: "/staffDailyCheck/updateStatus",
            method: "post",
            data,
        });
    },
    //    pageDataXls:(_searchParam: any,_xlsTitle: any) => {
    //     const param = new URLSearchParams();
    //     param.append("_searchParam",JSON.stringify(_searchParam))
    //     param.append("_xlsTitle",_xlsTitle)
    //     param.append("_xlsName",_xlsName)
    //     return request({
    //         url: "/staffDailyCheck/pageDataXls", 
    //         method: "post",
    //         responseType: 'blob',
    //         params:param,
    //     }).then((res)=> {
    //         download(res)
    //     });
    // },
    pageDataXls:(_searchParam: any,_xlsTitle: any) => {
              const param = new URLSearchParams();
        param.append("_searchParam",JSON.stringify(_searchParam))
        param.append("_xlsTitle",_xlsTitle)
        return request({
            url: "/staffDailyCheck/pageDataXls",
            method: "post",
            responseType: 'blob',
            headersType: 'application/json;charset=UTF-8',
           params:param,
        }).then((res)=> {
            download(res)
        });
    },
};
export default StaffDailyCheckApi;
